#include"Snake.h"

void HideCursor()
{
	HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
	CONSOLE_CURSOR_INFO curinfo;
	GetConsoleCursorInfo(handle, &curinfo);
	curinfo.bVisible = false;
	SetConsoleCursorInfo(handle, &curinfo);
}

void GAME()
{
	Snake head;
	Wall w;
	w.Print();
	Snake::Food food(head);
	while (head.CheckSnake())
	{
		food.Print();
		head.judge_Dir();
		head.Move();
		food.EatFood(head);
		head.aided();
		head.sleep();
	}
	return;
}

int main()
{
	srand((unsigned)time(nullptr));
	system("mode con cols=170 lines=45");
	HideCursor();

	GAME();

	getchar();
	return 0;
}